﻿#pragma once

#include <QWidget>
#include "ui_PixelFormatConversionToolWindow.h"
#include <QCloseEvent>
#include <QResizeEvent>
#include <QDebug>
#include "PixelFormatConversionTool.h"
#include <QString>

/// <summary>
/// 像素格式转换工具
/// </summary>
class PixelFormatConversionToolWindow : public QWidget
{
	Q_OBJECT

public:
	PixelFormatConversionToolWindow(QWidget *parent = nullptr);
	~PixelFormatConversionToolWindow();
protected:
	// 重写关闭事件处理函数
	void closeEvent(QCloseEvent* event) override;
	void resizeEvent(QResizeEvent* event) override;

public slots:
	void startChange();
	void choiceSrcFile();
	void choiceTargetFilePath();
	void onSrcPixformatChanged(int pos);
	void choiceTargetPixformatFilePath(int pos);

private:
	Ui::PixelFormatConversionToolWindow ui;
	PixelFormatConversionTool* tool = nullptr;
	QString inFilePath;
	QString outFilePath;
	int srcWidth = 400;
	int srcHeight = 300;
	int targetWidth = 400;
	int targetHeight = 300;
	PixelFormatConversionTool::PIXFMT inPixFormat = PixelFormatConversionTool::RGBA;
	PixelFormatConversionTool::PIXFMT outPixFormat = PixelFormatConversionTool::YUV420P;

};
